#include <iostream>
#include <array>
#include <stdio.h>
#include <stdint.h>
using namespace std;

struct Point {
    float x;
    float y;
    float z;
};

array<uint8_t, 64> point_array = { 0 };

int main() {
    // 安全的内存修改
    uint32_t point_max = point_array.size() / sizeof(Point);
    struct Point* p_head = (Point*)point_array.data();
    struct Point* p;
    for (uint32_t i = 0; i < point_max; ++i) {
        p = p_head + i;
        p->x = i;
        p->y = i;
        p->z = i;
    }

    // 安全的内存读取
    for (uint32_t i = 0; i < point_max; ++i) {
        p = p_head + i;
        printf("Point[%d] = {%f, %f, %f}\n", i, p->x, p->y, p->z);
    }

    return 0;
}